Rem BasicCard Sample Source Code
Rem ------------------------------------------------------------------
Rem Copyright (C) 1997-2008 ZeitControl GmbH
Rem You have a royalty-free right to use, modify, reproduce and 
Rem distribute the Sample Application Files (and/or any modified 
Rem version) in any way you find useful, provided that you agree 
Rem that ZeitControl GmbH has no warranty, obligations or liability
Rem for any Sample Application Files.
Rem ------------------------------------------------------------------

Option Explicit

#Include COMMERR.DEF
#Include ECTERM.DEF
#Include MISC.DEF

Private PrivateKey$, PublicKey$

ResetCard : Call CheckSW1SW2()

Rem  Get the card's curve parameters
Private Curve As Integer
Call GetCurveIndex (Curve) : Call CheckSW1SW2()

Call ECpSetCurve (Curve) : Call CheckLibError()

Rem  Set up the Terminal program private and public keys
PrivateKey$=BuildKeyForCurve(Curve, "ECTERM Test Program Private Key")
Call ECpMakePublicKey(PrivateKey$, PublicKey$)
Call CheckLibError()

Rem  Time the card while it generates a private key
Private StartTime As DateTime, EndTime As DateTime, Interval As Long

Print "Card is generating private key..." ;
Call GetDateTime (StartTime)
Call GenerateKey()
Call GetDateTime (EndTime)
Call CheckSW1SW2()

Interval = TimeInterval (StartTime, EndTime)
Print 0.001 * Interval ; : Print "seconds"


